<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let s = new Set([1, 2, 3, 4, 5, 6, 1, 2]);
      console.log(s); //自动去重
      console.log(s.size);
      s.add(9);
      console.log(s);
      s.delete(6);
      console.log(s);
      console.log(s.has(5));
      console.log(s.has(6));
      //   s.clear();
      //   console.log(s);\

      //遍历
      for (let i of s) {
        console.log(i);
      }
    </script>
  </body>
</html>
